#include "../liolib/lioflat.h"

class Plotter:public FlatApplication
{
protected:
	FlatButton
		bSize,
		bSave,
		bOpen,
		bAppend,
		bText,
		bExit,
		bCapture;
	FlatChoice
		chFormat;
	FlatText
		tbSizeX,
		tbSizeY,
		tbFile,
		tbAppend,
		tbCapture,
		tbCompr;
	FlatGraph fg;
	Font fontSmall;
	Limit<double> graphLimX,graphLimY;
	Channel *activeChnl;

	BOOL create();
	void destroy();
	void reshape ();
	BOOL listen(WORD id, WORD code, const void *info);
	void updateGraph();
	void adjustWindow();
	BOOL open(CSTR filename);
	BOOL save(CSTR filename);
	void capture();
	BOOL glCreate()
	{
		if(!FlatApplication::glCreate())
			return FALSE;
		adjustWindow();
		return TRUE;
	}
};